<template>
	<view class="content padding ffffff">
		<view class="flexbetween margin_bottom5" @click="goRevisePhone">
			<view class="text_g color_ling">
				更换手机号
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<view class="flexbetween margin_bottom5" @click="show=true">
			<view class="text_g color_ling">
				注销账号
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<u-modal :show="show" :title="title" showCancelButton confirmText="确认注销" confirmColor="#F3271C" @cancel="show=false" @confirm="submit">
			<view class="slot-content word_wrap">
				<u-parse :content="shopInfo.sys_user_cancel"></u-parse>
			</view>
		</u-modal>
		<!-- 底部 -->
		<!-- <view class="footer ffffff padding">
			<view class="footerButton">
				退出登录
			</view>
		</view> -->
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				title: "注销协议",
				shopInfo: {},
			}
		},
		async onLoad() {
			let res=await this.initApp()
			this.shopInfo=res.data
		},
		methods: {
			submit(){
				let _this = this
				httpRequest.request('/api/user/cancel', 'POST', {
					
				}).then(res => {
					httpRequest.toast(res.msg);
					_this.show=false
					if(res.code==1){
						setTimeout(()=>{
							// uni.navigateBack(1)
							uni.reLaunch({
								url:"/pages/mine/mine"
							})
						},500)
					}
				})
			},
			goRevisePhone() { //更换手机号
				uni.navigateTo({
					url: "./revisePhone"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.slot-content {
		height: 500rpx;
		overflow-y: auto;
	}
</style>